﻿# 使用官方 ASP.NET Core 运行时镜像作为基础镜像
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
EXPOSE 5000 5001

# 使用官方 .NET SDK 镜像作为构建镜像
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY . .
RUN dotnet restore "WebApplication1/WebApplication1.csproj"
RUN dotnet publish "WebApplication1/WebApplication1.csproj" -c Release -o /app

# 使用基础镜像作为最终运行镜像
FROM base AS final
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "WebApplication1.dll"]